package com.atguigu.strategy.improve;

public class Client {

	public static void main(String[] args) {
		System.out.println("========野鸭子=================");
		DuckForWild wildDuck = new DuckForWild();
		wildDuck.fly();//
		wildDuck.quack();

		System.out.println("=====玩具鸭子====================");
		DuckForToy toyDuck = new DuckForToy();
		toyDuck.fly();
		toyDuck.quack();

		System.out.println("=======北京鸭子==================");
		DuckForPeking pekingDuck = new DuckForPeking();
		pekingDuck.fly();
		pekingDuck.quack();

		System.out.println("====== 改变北京鸭子的飞翔能力 =================");

		// 动态改变某个对象的行为, 北京鸭 不能飞
		pekingDuck.setFlyBehavior(new FlyBehaviorForNo());
		pekingDuck.fly();
	}

}
